import { translate } from '@/utils/i18n'
export const formItems = [
  {
    filed: 'venueId',
    type: 'select',
    label: translate('venue'),
    labelCode: 'name',
    valueCode: 'id',
    options: []
  },
  {
    filed: 'courseName',
    type: 'input',
    label: translate('courseName')
  },
  // {
  //   filed: 'courseType',
  //   type: 'select',
  //   label: '课程分类',
  //   options: [{ value: '1', label: '线上' },
  //     { value: '2', label: '线下' }]
  // },
  {
    filed: 'time',
    type: 'daterange',
    clearable: false,
    label: translate('rq'),
    pickerOptions: {
      shortcuts: [{
        text: translate('jin7'),
        onClick(picker) {
          const end = new Date()
          const start = new Date()
          end.setTime(end.getTime())
          start.setTime(start.getTime() - 3600 * 1000 * 24 * 6)
          picker.$emit('pick', [start, end])
        }
      },
      {
        text: translate('jin30'),
        onClick(picker) {
          const end = new Date()
          const start = new Date()
          end.setTime(end.getTime())
          start.setTime(start.getTime() - 3600 * 1000 * 24 * 29)
          picker.$emit('pick', [start, end])
        }
      },
      {
        text: translate('jin60'),
        onClick(picker) {
          const end = new Date()
          const start = new Date()
          end.setTime(end.getTime())
          start.setTime(start.getTime() - 3600 * 1000 * 24 * 59)
          picker.$emit('pick', [start, end])
        }
      },
      {
        text: translate('jin90'),
        onClick(picker) {
          const end = new Date()
          const start = new Date()
          end.setTime(end.getTime())
          start.setTime(start.getTime() - 3600 * 1000 * 24 * 89)
          picker.$emit('pick', [start, end])
        }
      }],
      disabledDate(time) {
        var curDate = new Date(new Date().toLocaleDateString()).getTime()
        var preDate = new Date(curDate)
        return time.getTime() > preDate
      }
    }
  }
]
export const queryFormConfig = {
  formItems,
  online: true
}
